<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script>
  let user = {name: 'houdunren', age: 11}

  let {name: n, age: m} = user;
  console.log(n, m)

  //    进一步简化
  let {name, age} = user;
  console.log(name, age)

  function hd() {
    return {admin: 'wzy', sex: 'nan'}
  }

  let {admin, sex} = hd();
  console.log(admin, sex)

  //    函数应用
  function person({name, age}) {
    console.log(name, age)
  }

  person({name: "kk", age: 33})

  let {random} = Math;

  console.log(random())

</script>
</body>
</html>
